We can use simple functions like the one above to do a particular job for us. Whenever we find ourselves repeating a block of code somewhere in the program we could think about putting it into a function and then calling the function when we need it. This is good programming practice. If we find that there is something wrong with the function we can change the single copy and don't have to worry about updating lots of others.
Another good use for functions is to break a large project into a number of smaller problems. We could take a large program and break it into chunks like read data, process data and print results. We could then write each function separately. When programmers co-operate on very large projects you often find that they split the work into functions and then each programmer writes some of them.
Putting code into functions can also help with the testing of a program. If you write some code which calls your function (this is often called a test harness) it can automatically check that the function does the right thing. Something you must always remember is that whenever you create a system you must concern yourself with how it will be tested. If the only way we can test your Nuclear Reactor Control Program is to plug it into a reactor and fire it up you may find that customers are rather hard to come by.....
One of the things that you must also consider is that when we put code into functions we are performing one of the oldest trade-offs in the programmer's book. We make our program smaller, because there is only one copy of the function code, but we also make the program slower because the PICmicro microcontroller now has to find its way to the function each time and then find its way back. If you are really (and I mean really) worried about speed you can think about repeating the code each time you want to use it. However, in the programs that we are going to write the we are prepared to trade a little speed for code which is easier to write and understand, and is also smaller.